<?php
/* Reflux
*  Author: Zengjunjie <info@mrzenix.com>
*  File: /trunk/htdocs/core/StorageInterface.php
*  Usage: 
*  Format: 1 tab indent(2 spaces), LF, UTF-8, no-BOM
*
*  Subversion Keywords:
*
*  $Id: StorageInterface.php 10 2009-07-22 18:21:02Z mrzenix@gmail.com $
*  $LastChangedDate: 2009-07-22 18:21:02 +0000 (Wed, 22 Jul 2009) $
*  $LastChangedRevision: 10 $
*  $LastChangedBy: mrzenix@gmail.com $
*  $URL: http://reflux.googlecode.com/svn/trunk/htdocs/core/StorageInterface.php $
*
* Copyright (C) 2009 Zengjunjie <info@mrzenix.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
 * Storage interface for reflux Storage system
 *
 * This is a storage system interface. It provide Reflux base storage(i/o) function.
 *
 * @version 0.01
 * @package Reflux
 * @subpackage Storage Driver
 * @author mrzenix
 **/
interface rxiStorage
{
  public $db;

  /**
   * _db_c_i function means Connect to your select database(Set it in Settings.php)
   * It operate $conn variable.
   *
   * @return void
   * @author mrzenix
   *
   **/
  public function _db_c_i();
  
  /**
   * _db_c_i function means close your select database connection
   * It operate $conn variable.
   * 
   * @return void
   * @author mrzenix
   *
   **/
  public function _db_c_c();
  
  /**
   * _db_s_a function means "Select * from $table"
   *
   * @return $row[]
   * @param string $table
   * @author mrzenix
   *
   **/
  public function _db_s_a($table);
  /**
   * _db_s_a function means "Select * from $table where $field[i][0]=$fieldp[i][1] ..."
   *
   * @return $row[]
   * @param array()[][] $field
   * @param string $table
   * @author mrzenix
   *
   **/
  public function _db_s_a_f($field=array(),$table);
  /**
   * _db_s_f function means "Select $field[i],$field[i+1].. from $table"
   *
   * @return $row[]
   * @param array() $field
   * @param string $table
   * @author mrzenix
   *
   **/
  public function _db_s_f($field=array(),$table);
  /**
   * _db_s_a_f_t function means "Select $field[i],$field[i+1] ... from $table where $field[i][0]=$fieldp[i][1] ..."
   *
   * @return $row[]
   * @param array() $field
   * @param array() $terms
   * @param string $table
   * @author mrzenix
   *
   **/
  public function _db_s_f_t($field=array(),$terms=array(),$table);
  
  
  /* Insert */
  /**
   * _db_i function means "INSERT INTO $table($value[KEY],$value[KEY+1]) VALUES($value[0],$value[1])"
   * if no KEYS, There will means "INSERT INTO $table VALUES($value[0],$value[1])"
   *
   * @return bool
   * @param array() $value
   * @param string $table
   * @author mrzenix
   *
   **/
  public function _db_i($value=array(),$table);
  
  /**
   * _db_u function means "update $table set $array[KEY]=$array[KEY+1])"
   *
   * @return bool
   * @param array() $field
   * @param string $table
   * @author mrzenix
   *
   **/
  public function _db_u($field=array(),$table);
  
  /* delete */
  /**
   * _db_d function means "delete $table where $terms[KEY]=$terms[KEY+1])"
   *
   * @return bool
   * @param array() $field
   * @param string $table
   * @author mrzenix
   *
   **/
  public function _db_d($terms=array(),$table);
  
  /* get version */
  /**
   * get database' version
   *
   * @return string
   * @author mrzenix
   *
   **/
  public function _db_v();
} // END interface rxStoreage
?>